package me.green.ui.component;

import javax.swing.*;
import java.awt.*;

public class JImagePanel extends JPanel {

    private ImageIcon bgImage;

    public JImagePanel(ImageIcon bgImage){
        this.bgImage = bgImage;
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        // 自适应大小
        g.drawImage(bgImage.getImage(), 0, 0, this.getWidth(), this.getHeight(), this);
    }
}
